import Cookies from 'js-cookie'

// InitMallUserKey: username username操作 初始登录的时候需要

var Keys = {
  TokenKey: 'MS-Token',
  UserInfoKey: 'MS-UserInfo',
  InitMallUserKey: 'MS-InitUser'
}


export function getToken() {
  return Cookies.get(Keys.TokenKey)
}

export function setToken(token) {
  return Cookies.set(Keys.TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(Keys.TokenKey)
}


// getAuthUserInfo
export function getAuthUserInfo() {
  return Cookies.get(Keys.UserInfoKey)
}

export function setAuthUserInfo(data) {
  return Cookies.set(Keys.UserInfoKey, data)
}

export function removeAuthUserInfo() {
  return Cookies.remove(Keys.UserInfoKey)
}

// getInitUser
export function getInitUser() {
  return Cookies.get(Keys.InitMallUserKey)
}

export function setInitUser(data) {
  return Cookies.set(Keys.InitMallUserKey, data)
}

export function removeInitUser() {
  return Cookies.remove(Keys.InitMallUserKey)
}
